<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:p="http://primefaces.org/ui"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core">
    
    <h:head>
        <title>Excluir Eleitor</title>
    </h:head>
    
    <h:body>
        
    <h:form id="menuprincipal">
        
       <p:menubar>
       
           <p:submenu label="Cadastrar" icon="ui-icon-document">  
             <p:menuitem value="Candidatos" icon="ui-icon-document" url="/faces/cadastro_candidato.xhtml" ajax="true" />
             <p:menuitem value="Eleitores" icon="ui-icon-document" url="/faces/cadastro_eleitor.xhtml" ajax="true" />
          </p:submenu>
            
          <p:submenu label="Excluir" icon="ui-icon-close">  
             <p:menuitem value="Excluir Eleitores" url="/faces/exclui_eleitor.xhtml" icon="ui-icon-close" ajax="true" />
          </p:submenu>
  
          <p:submenu label="Editar" icon="ui-icon-pencil">  
             <p:menuitem value="Editar Candidatos" url="/faces/seleciona_candidato.xhtml" icon="ui-icon-pencil" ajax="false" />
          </p:submenu>
       
          <p:submenu label="Pesquisar" icon="ui-icon-search">
             <p:menuitem value="Pesquisar Eleitor" icon="ui-icon-search" url="/faces/pesquisa.xhtml" ajax="true" />
             <p:menuitem value="Exibir Todos" icon="ui-icon-search" url="/faces/relatorio.xhtml" ajax="true" />
          </p:submenu>
           
           <p:submenu label="Gráficos" icon="ui-icon-search">
               <p:menuitem value="Total de votos" icon="ui-icon-search" url="/faces/total_votos.xhtml" ajax="false" /> 
           </p:submenu>
  
          <p:submenu label="Ajuda" icon="ui-icon-help">  
              <p:menuitem value="Sobre o Sistema" icon="ui-icon-help" url="#" ajax="false" onclick="dialogo.show()" />
          </p:submenu>
           
       </p:menubar>  
      
    </h:form>
        
    <p:panel header="Excluir" style="width: 70%">
                    
       <p:tab title="Excluir Eleitor" id="eleitorTab">
       
          <h:form id="excluiForm">
                        
             <h:panelGrid columns="3" cellpadding="3">
                            
                <h:outputText value="Nome" />
                <p:autoComplete value="#{eleitorC.eleitorSelecionado}" id="nomeInput" completeMethod="#{eleitorC.complete}" var="n" itemLabel="#{n.nome}" itemValue="#{n}" converter="#{eleitorConverter}" minQueryLength="1" size="70" maxResults="30" forceSelection="true" required="true" requiredMessage="O nome é um campo obrigatório!" dropdown="true" /><h:message for="nomeInput" />
                                                       
                <p:growl id="messages" />  
                <p:commandButton id="showDialogButton" value="Excluir Eleitor" onclick="confirmation.show()" type="button"/>  
                <p:confirmDialog id="confirmDialog" message="Deseja realmente excluir o eleitor selecionado?" header="Confirmação de Exclusão" severity="alert" widgetVar="confirmation">  
                   <p:commandButton id="confirm" value="Sim" update="messages" action="#{eleitorC.excluir(eleitorC.eleitorSelecionado)}" oncomplete="confirmation.hide()" ajax="false"  />
                   <p:commandButton id="decline" value="Não" onclick="confirmation.hide()" type="button" />
                </p:confirmDialog>
                            
             </h:panelGrid>
          </h:form>
                        
       </p:tab>
           
       </p:panel>
        
       <p:dialog id="modaldialogo" header="Sobre" widgetVar="dialogo" modal="true" height="100">
            <h:outputText value="Desenvolvido por Primatech Software Corporation - 2013" />
        </p:dialog>
        
        <div id="sobre" style="width: 100%; height: 25px; text-align: center; font-size: 15px; font-weight: bold; background: limegreen; color: black; margin-top: 500px">
           <p style="padding-top: 3px">DESENVOLVIDO POR PRIMATECH SOFTWARE CORPORATION - 2013</p>
        </div>
        
    </h:body>
    
</html>